from myelin.rdf.Ns import RDFS, OWL_NS, DAML_OIL_NS
from myelin.rdf.bindery.ObjectTypes import ResourceTypeO, LiteralTypeO

from VocabSchema import VocabSchema

from ObjectTypes import \
    ClassTypeO, ClassTypeS, \
    PropertyTypeO

from mappings import \
    SchemaSetsMap, SchemaRelationsMap, \
    SchemaHierarchyMap, \
    DomainOfMap, RangeOfMap


class Class(VocabSchema):
    
    ModelTypes = (ClassTypeO, ClassTypeS)
    
    RDF_BINDINGS = {
        'owlSameAs'         : ((OWL_NS, 'sameAs'), ClassTypeO, SchemaSetsMap),
        'owlUnionOf'        : ((OWL_NS, 'unionOf'), ClassTypeO, SchemaSetsMap),
        'owlDisjointWith'   : ((OWL_NS, 'disjointWith'), ClassTypeO, SchemaSetsMap),
        'owlComplementOf'   : ((OWL_NS, 'complementOf'), ClassTypeO, SchemaSetsMap),
        'owlInverseOf'      : ((OWL_NS, 'inverseOf'), ClassTypeO, SchemaSetsMap),
        
        'damlUnionOf'        : ((DAML_OIL_NS, 'unionOf'), ClassTypeO, SchemaSetsMap),
        'damlComplementOf'   : ((DAML_OIL_NS, 'complementOf'), ClassTypeO, SchemaSetsMap),
        'damlSameClassAs'    : ((DAML_OIL_NS, 'sameClassAs'), ClassTypeO, SchemaSetsMap),        
    
        'rdfsDomainOf'         : ((RDFS, 'domain'), PropertyTypeO, DomainOfMap),
        'rdfsRangeOf'          : ((RDFS, 'range'), PropertyTypeO, RangeOfMap),
        'rdfsSubClassOf'       : ((RDFS, 'subClassOf'), ClassTypeO, SchemaHierarchyMap),
    }

CLASS_TYPES = {
    RDFS + 'Class' : Class,
    OWL_NS + 'Class' : Class,
}